import request from '@/plugins/axios/request';
const baseURL = process.env.VUE_APP_BASE_API;
//[经费管理]分页查询-科研人员
export function fundlList(data) {
  return request({
    url: `${baseURL}/tech-fund/page`,
    method: "post",
    data: data,
  });
}

//[经费管理]分页查询-管理人员（仅用于科研端）
export function fundList(data) {
  return request({
    url: `${baseURL}/tech-fund/page`,
    method: "post",
    data: data,
  });
}

//[经费管理]分页查询-管理人员（仅用于管理端）
export function fundListManage(data) {
  return request({
    url: `${baseURL}/tech-fund/page-manage`,
    method: "post",
    data: data,
  });
}

//[经费管理]导出word
export function exportFundDocx(data) {
  return request({
    url: `${baseURL}/tech-fund/exportFundDocx`,
    method: 'data',
    params: data,
    isDownLoadFile:true
  })
}

//[经费管理]导出excel
export function exportFundExcel(data) {
  return request({
    url: `${baseURL}/tech-fund/exportFundExcel`,
    method: 'data',
    params: data,
    isDownLoadFile:true
  })
}
//[代码接口]下拉框
export function getOptions(params) {
  return request({
    url: `${baseURL}/tech-dict/select`,
    method: "get",
    params,
  });
}
//[经费管理]新增经费
export function insertFund(data) {
  return request({
    url: `${baseURL}/tech-fund/insertFund`,
    method: "post",
    data: data,
  });
}
//[经费管理]获取项目名称
export function getProjectName() {
  return request({
    url: `${baseURL}/tech-fund/getProjectName`,
    method: "get",
  });
}
//[经费管理]编辑经费
export function updateFund(data) {
  return request({
    url: `${baseURL}/tech-fund/updateFund`,
    method: "post",
    data: data,
    isShowMessage:true
  });
}
//[经费管理]删除经费
export function deleteFund(fundIds) {
  return request({
    url: `${baseURL}/tech-fund/delete`,
    method: "post",
    data: {
      fundIds,
    },
  });
}
//[经费管理]外协经费-分页查询
export function outFund(data) {
  return request({
    url: `${baseURL}/tech-out-fund/page`,
    method: "post",
    data,
  });
}
//[经费管理]新增外协经费
export function addOutFund(data) {
  return request({
    url: `${baseURL}/tech-out-fund/addOutFund`,
    method: "post",
    data,
  });
}
//[经费管理]更改外协经费
export function updateOutFund(data) {
  return request({
    url: `${baseURL}/tech-out-fund/updateOutFund`,
    method: "post",
    data,
  });
}
//[经费管理]删除外协经费
export function delOutFund(outFundIds) {
  return request({
    url: `${baseURL}/tech-out-fund/delete`,
    method: "post",
    data: {
      outFundIds,
    },
  });
}

//[经费管理]查询项目所有经费详情
export function allFundDetail(data) {
  return request({
    url: `${baseURL}/tech-fund-detail/selectAll`,
    method: "POST",
    data: data,
  });
}
//[经费管理]录入详情开支内容
export function addDevice(data) {
  return request({
    url: `${baseURL}/tech-device/insertDevice`,
    method: "POST",
    data,
  });
}
//[经费管理]获取详情开支内容
export function getDeviceDetail(fundDetailId) {
  return request({
    url: `${baseURL}/tech-device/getDevices`,
    method: "POST",
    data: {
      fundDetailId,
    },
  });
}
//[经费管理]新增开支明细
export function addSpend(data) {
  return request({
    url: `${baseURL}/tech-fund-detail/addFundDetail`,
    method: "POST",
    data,
    isShowMessage:true
  });
}
//[经费管理]更改开支明细
export function updateSpend(data) {
  return request({
    url: `${baseURL}/tech-fund-detail/updateFundDetail`,
    method: "POST",
    data,
  });
}
//[经费管理]删除开支明细
export function delSpend(detailIds) {
  return request({
    url: `${baseURL}/tech-fund-detail/delete`,
    method: "POST",
    data: {
      detailIds,
    },
  });
}


//[经费管理]新增收入经费
export function addIncome(data) {
  return request({
    url: `${baseURL}/techInFund/add`,
    method: "POST",
    data,
  });
}

//[经费管理]收入经费分页查询
export function getIncomeList(data) {
  return request({
    url: `${baseURL}/techInFund/queryByPage`,
    method: "POST",
    data,
  });
}

//[经费管理]修改收入经费
export function editIncome(data) {
  return request({
    url: `${baseURL}/techInFund/edit`,
    method: "POST",
    data,
  });
}

//[经费管理]删除收入经费
export function delIncome(data) {
  return request({
    url: `${baseURL}/techInFund/deleteById/` + data,
    method: "POST",
  });
}
